/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * <p>Project: app2022 - Nio1
 * <p>Powered by webrx On 2022-01-20 11:21:14
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Nio1 {
    public static void main(String[] args) {
        var p = Paths.get("u3.txt");
        System.out.println(p);
        System.out.println(p.toFile());

        //file:///C:/app2022/u3.txt
        System.out.println(p.toUri());
        if (Files.exists(p)) {
            System.out.println("文件存在");
        } else {
            try {
                Files.createFile(p);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
